﻿using BrnMall.Manager.Domain.Ship;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrnMall.Manager.Manager.Ship
{
   public class ShipConfigManager
    {
        /// <summary>
        /// 添加配送设置
        /// </summary>
        public static bool Add(ShipConfig model)
        {
            object obj = null;
            using (var db = new QDMallDatabase())
            {
                obj = db.Insert(model);
            }
            return obj != null ? true : false;
        }

        public static int Update(ShipConfig model)
        {
            using (var db = new QDMallDatabase())
            {
                return db.Update(model);
            }
        }


        public static ShipConfig GetByStoreId(int storeId)
        {
            using (var db = new QDMallDatabase())
            {
                return db.SingleOrDefault<ShipConfig>(string.Format("select top 1 * from bma_shipConfig where storeid={0}", storeId));
            }
        }

    }
}
